// 代码混淆
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')

const vueConfig = {
  publicPath:'./',
  devServer: {
    port: 8082,
    proxy: {
      '/api': {
        // target: 'http://120.79.132.35:8804',
        // target: 'http://192.168.1.28:8804',
        // target: 'https://taml.csair.com/api',
        target: 'http://192.168.1.55:8804',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  configureWebpack: {
    resolve: {
      alias: {
        'assets': '@/assets'
      }
    },
    plugins: [
      new UglifyJSPlugin()
    ]
  },
  chainWebpack: config => {
    config.entry('main').add('babel-polyfill')
    config.entry.app = ['babel-polyfill', './src/main.js']
  },
  transpileDependencies: [
    'node_modules/lib-emas'
  ]
}

module.exports = vueConfig
